﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace DusonFramework.Core.Web
{
    public class WebControls
    {
        /// <summary>
        /// 得到控件的客户端ID
        /// </summary>
        /// <param name="control"></param>
        /// <returns></returns>
        public static string GetChildControlPrefix(Control control)
        {
            if (control.NamingContainer.Parent == null)
            {
                return control.ID;
            }
            else
            {
                return String.Format("{0}_{1}", control.NamingContainer.ClientID, control.ID);
            }
        }

    }
}
